package com.huawei.service.impl;

import com.huawei.dao.DingdanMapper;
import com.huawei.dao.DingdanxqMapper;
import com.huawei.entity.Dingdanxq;
import com.huawei.service.DingdanxqService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @ClassName DingdanxqImpl
 * @Description TODO
 * @Author 马效鹏
 * @Date 2021/11/29 18:18
 */
    @Service
public class DingdanxqImpl implements DingdanxqService {
    @Resource
    DingdanxqMapper dingdanxqMapper;
    @Resource
    DingdanMapper dingdanMapper;
    @Override
    public List<Dingdanxq> selectAll(Map<String, Object> pars) {
        List<Dingdanxq> list=dingdanxqMapper.selectAll(pars);
        for (Dingdanxq n:list){
            n.setDingdan2(dingdanMapper.getId(n.getDingdan_id()));
        }
        return dingdanxqMapper.selectAll(pars);
    }

    @Override
    public int count(Map<String, Object> pars) {
        return dingdanxqMapper.count(pars);
    }

    @Override
    public int add(Dingdanxq dingdanxq) {

            return dingdanxqMapper.add(dingdanxq);

    }

    @Override
    public int update(Dingdanxq dingdanxq) {

            return dingdanxqMapper.update(dingdanxq);

    }

    @Override
    public int delete(int dingdanxq_id) {
        return dingdanxqMapper.delete(dingdanxq_id);
    }
}
